<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>$compile_check</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="api.variables.html" title="Chapter 13. Smarty Class Variables">
<link rel="prev" href="variable.caching.type.html" title="$caching_type">
<link rel="next" href="variable.compile.dir.html" title="$compile_dir">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">$compile_check</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="variable.caching.type.html">Prev</a> </td>
<th width="60%" align="center">Chapter 13. Smarty Class Variables</th>
<td width="20%" align="right"> <a accesskey="n" href="variable.compile.dir.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="$compile_check">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="variable.compile.check"></a>$compile_check</h2></div></div></div>
<p>
	   Upon each invocation of the PHP application, Smarty tests to see if the
	   current template has changed (different timestamp) since the last time
	   it was compiled. If it has changed, it recompiles that template. If the
	   template has yet not been compiled at all, it will compile regardless of this
	   setting. By default this variable is set to <code class="constant">TRUE</code>.
      </p>
<p>Once an application is
	   put into production (ie the templates won't be changing),
       the compile check step is no longer needed. Be sure to set
       <em class="parameter"><code>$compile_check</code></em> to <code class="constant">FALSE</code> for
	   maximum performance. Note that if you change this to <code class="constant">FALSE</code> and a
	   template file is changed, you will *not* see the change since the
	   template will not get recompiled.
	  </p>
<p>
	   If <a class="link" href="variable.caching.html" title="$caching"><em class="parameter"><code>$caching</code></em></a>
	   is enabled and <em class="parameter"><code>$compile_check</code></em> is enabled, then
       the cache files will get regenerated if an involved template file or 
       config file was updated. 
	  </p>
<p>
	   As of Smarty 3.1 <em class="parameter"><code>$compile_check</code></em> can be set to the value 
	   <code class="literal">Smarty::COMPILECHECK_CACHEMISS</code>. This enables Smarty to
	   revalidate the compiled template, once a cache file is regenerated. So if there was
	   a cached template, but it's expired, Smarty will run a single compile_check before
	   regenerating the cache.
	  </p>
<p>
	   See <a class="link" href="variable.force.compile.html" title="$force_compile"> <em class="parameter"><code>$force_compile</code></em></a> and 
	   <a class="link" href="api.clear.compiled.tpl.html" title="clearCompiledTemplate()"><code class="varname">clearCompiledTemplate()</code></a>.
      </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="variable.caching.type.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="api.variables.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="variable.compile.dir.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">$caching_type </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> $compile_dir</td>
</tr>
</table>
</div>
</body>
</html>
